From cb48fe6a7925ef745d973dc24e636dd17eee3c90 Mon Sep 17 00:00:00 2001
From: Daniel Carl <danielcarl@gmx.de>
Date: Mon, 9 Mar 2015 21:43:37 +0100
Subject: [PATCH] Fix segfault on config file with invalid commands (#188).

In case the file contained invalid commands, this was shown to the user by
using vb_echo() which writes the error message into the inpubox. But this
triggered the already buffer_changed_cb that delegated the changed buffer
event to the current mode.
Long story short, there was no current mode set before which caused the
segfault.
---
 src/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main.c b/src/main.c
index 51c900e..c60d7a2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1029,6 +1029,9 @@ static void init_core(void)
 #endif
     map_init();
 
+    /* enter normal mode */
+    vb_enter('n');
+
     setup_signals();
 
     /* make sure the main window and all its contents are visible */
@@ -1050,9 +1053,6 @@ static void init_core(void)
         g_object_set(G_OBJECT(setting), "enable-default-context-menu", false, NULL);
     }
 
-    /* enter normal mode */
-    vb_enter('n');
-
     vb.config.default_zoom = 1.0;
 
 #ifdef FEATURE_HIGH_DPI
-- 
2.20.1